
//
//  SEGKnowOpenDoorViewController.m
//  YYKitDemo
//
//  Created by 刘山 on 2017/11/8.
//  Copyright © 2017年 Sam. All rights reserved.
//

#import "SEGKnowOpenDoorViewController.h"

@interface SEGKnowOpenDoorViewController ()

@end

@implementation SEGKnowOpenDoorViewController{
    UIScrollView *scrollView;
}
-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    if (self.isHideBar) {
        self.navigationController.navigationBarHidden=NO;
    }
}
-(void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    if (self.isHideBar) {
        self.navigationController.navigationBarHidden=YES;
    }
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"了解一键开门";
    [self showCustomNavigationBackButton];
    self.automaticallyAdjustsScrollViewInsets = NO;
    self.view.backgroundColor = kColor_W;
    
    NSArray *dataSourceImages = @[@"img_opendoor_profileimg_01",
                                  @"img_opendoor_profileimg_02",
                                  @"img_opendoor_profileimg_03",
                                  @"img_opendoor_profileimg_04"];
    
    scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, LYScreenWidth(), LYScreenHeight() - kNavigationBarAndStatusBarHeight)];
    [self.view addSubview:scrollView];
    
    CGFloat _height = 0;
    for (NSString *object in dataSourceImages) {
        UIImageView *imageView = [[UIImageView alloc]initWithImage:[UIImage imageWithContentsOfFile:SEGPicName(object)]];
        [imageView sizeToFit];
        [scrollView addSubview:imageView];
        [imageView setFrame:CGRectMake(0, _height, scrollView.width, imageView.height)];
        _height += imageView.height;
    }
    scrollView.contentSize = CGSizeMake(scrollView.width, _height);
    scrollView.backgroundColor = kColor_W;
}
@end
